From da8dac8320e7584164ad39e6bcb847e2df6696ae Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 16 Sep 2008 04:51:56 +0000 Subject: [PATCH] =?utf8?q?Bug=20551987=20=E2=80=93=20GtkPaned=20redrawing?= =?utf8?q?=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2008-09-16 Matthias Clasen Bug 551987 – GtkPaned redrawing problem * gtk/gtkhpaned.c: * gtk/gtkvpaned.c: Queue invalidations when the handle is moved due to child changes. Patch by Owen Taylor svn path=/trunk/; revision=21399 --- ChangeLog | 8 ++++++++ gtk/gtkhpaned.c | 11 +++++++++++ gtk/gtkvpaned.c | 11 +++++++++++ 3 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index e64c1ffb00..ac59e660d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-16 Matthias Clasen + + Bug 551987 – GtkPaned redrawing problem + + * gtk/gtkhpaned.c: + * gtk/gtkvpaned.c: Queue invalidations when the handle is moved + due to child changes. Patch by Owen Taylor + 2008-09-16 Matthias Clasen Bug 552001 – gtkimcontextsimple.c: variable is declared at middle of diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c index 365a53f560..f719d3dfed 100644 --- a/gtk/gtkhpaned.c +++ b/gtk/gtkhpaned.c @@ -130,6 +130,7 @@ gtk_hpaned_size_allocate (GtkWidget *widget, GtkAllocation child2_allocation; GtkRequisition child1_requisition; GtkRequisition child2_requisition; + GdkRectangle old_handle_pos; gint handle_size; gtk_widget_style_get (widget, "handle-size", &handle_size, NULL); @@ -143,6 +144,8 @@ gtk_hpaned_size_allocate (GtkWidget *widget, - 2 * border_width), child1_requisition.width, child2_requisition.width); + + old_handle_pos = paned->handle_pos; paned->handle_pos.x = widget->allocation.x + paned->child1_size + border_width; paned->handle_pos.y = widget->allocation.y + border_width; @@ -164,6 +167,14 @@ gtk_hpaned_size_allocate (GtkWidget *widget, flip_child (widget, &(paned->handle_pos)); } + if (GTK_WIDGET_MAPPED (widget) && + (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y || + old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height)) + { + gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE); + gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE); + } + if (GTK_WIDGET_REALIZED (widget)) { if (GTK_WIDGET_MAPPED (widget)) diff --git a/gtk/gtkvpaned.c b/gtk/gtkvpaned.c index 335d4352da..3b11db6d34 100644 --- a/gtk/gtkvpaned.c +++ b/gtk/gtkvpaned.c @@ -125,6 +125,7 @@ gtk_vpaned_size_allocate (GtkWidget *widget, GtkRequisition child2_requisition; GtkAllocation child1_allocation; GtkAllocation child2_allocation; + GdkRectangle old_handle_pos; gint handle_size; gtk_widget_style_get (widget, "handle-size", &handle_size, NULL); @@ -139,11 +140,21 @@ gtk_vpaned_size_allocate (GtkWidget *widget, child1_requisition.height, child2_requisition.height); + old_handle_pos = paned->handle_pos; + paned->handle_pos.x = widget->allocation.x + border_width; paned->handle_pos.y = widget->allocation.y + paned->child1_size + border_width; paned->handle_pos.width = MAX (1, (gint) widget->allocation.width - 2 * border_width); paned->handle_pos.height = handle_size; + if (GTK_WIDGET_MAPPED (widget) && + (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y || + old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height)) + { + gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE); + gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE); + } + if (GTK_WIDGET_REALIZED (widget)) { if (GTK_WIDGET_MAPPED (widget)) -- 2.30.2